package comdemo.controller;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LangChain4jController {

    @Autowired
    private OpenAiChatModel openAiChatModel;

    @RequestMapping("/langChain4j")

    public String langChain4j(String message){
        String result = openAiChatModel.chat(message);
        return result;
    }
}
